-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
markup/goldmark: Add attributes support for blocks (tables etc.) #8215
Conversation
There are some stuff left here. This first implementation has the attributes above the block (which also feels natural to me), but looking at what others have done/thinks about this, the common thing is to put it below, e.g.: > foo
> bar
{.myclass} vs {.myclass}
> foo
> bar
@yuin do you have any thoughts on this (also: re. my implementation in this PR)? /cc @jmooring |
334369d
to
fe372e4
Compare
IMHO, There are no standards for attributes. pandoc has the attributes above the block. |
fe372e4
to
1e557d3
Compare
@yuin thanks, I (and I suspect most people) do not care about table cells ... I think the test cases I've added would make most people happy. |
So, there are more to this syntax than the below, but what I can not make up my mind about is whether to place the {.myclass}
> foo
> bar Or > foo
> bar
{.myclass} |
Would it not make sense to follow the Commonmark and the Kramdown spec (i.e. after) to allow for everything to play well? @bep Is this something that could be configurable? |
Instead of above or below, think in terms of before or after. The existing implementation of heading attributes requires the attribute to be placed after the heading. |
Could, yes -- but ... that is a bad idea as it ties the content to the configuration making it very unportable. The current implementation in this PR allows both before/after, but I also think that is a bad idea. I think I agree with @jmooring -- and after is the closest we come to a "standard" at the moment. |
18d28e0
to
786fd43
Compare
E.g.: ``` > foo > bar {.myclass} ``` There are some current limitations: For tables you can currently only apply it to the full table, and for lists the ul/ol-nodes only, e.g.: ``` * Fruit * Apple * Orange * Banana {.fruits} * Dairy * Milk * Cheese {.dairies} {.list} ``` Fixes gohugoio#7548
786fd43
to
ddd3a93
Compare
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes #7548